const { getuser, deleusers } = require('../../service/main/getuser')
module.exports = {
    async getuser(ctx, next) {
        const { offset, limit, phone, name } = ctx.query
        const { rows, count } = await getuser(+offset, +limit, phone, name)
        ctx.body = {
            code: 200,
            msg: '查询成功',
            data: {
                rows,
                count,
                allpage: Math.ceil(count / limit)
            }
        }

    },
    async deleuser(ctx, next) {
        const { id } = ctx.query
        const rudata = await deleusers(id)
        console.log(rudata)
        ctx.body = {
            code: 200,
            msg: '删除成功'
        }
    }
}